{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d816334c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def f(x,C):\n",
    "    # Lifetime equation\n",
    "    # I1 * exp(- t / t1) + I2 * exp(- t / t2)\n",
    "    # C =  [I1,t1,I2,t2]\n",
    "    return C[0] * np.exp(- x / C[1]) + C[2] * np.exp(- x / C[3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "86fa36ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib. pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b544b349",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = 3\n",
    "C = [3,6,9,12]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fb457db8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8.828799026780544"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f(x,C)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "426cef52",
   "metadata": {},
   "outputs": [],
   "source": [
    "noiselevel = 0.1\n",
    "C = np.array([2,10,3.3,52])\n",
    "t = np.linspace(0,100,101)\n",
    "I = f(t,C) + (np.random.rand(t.size) - 0.5) * noiselevel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "45441ab3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x24ff550ceb0>]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwE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/nK1MfIiJyDCpqEREfp6IWEfFxKmoRER+nohYR8XEqahERH6eiFhHxcf8faQCkUur7V6EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(t,I)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "719ad2fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "def F(X,n,t,I):\n",
    "    result = np.zeros(n)\n",
    "    for i in range(n):\n",
    "        result[i] = f(t[i],X) - I[i]\n",
    "    return result\n",
    "def F2(X,t,I):\n",
    "    return f(t,X) - I"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "af6f42f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.02421745, -0.02206994,  0.00255382,  0.0461304 , -0.0013434 ,\n",
       "        0.01549033, -0.02938933, -0.02294274, -0.0337128 ,  0.04476461,\n",
       "        0.04121681,  0.0370715 , -0.00550983,  0.0061361 ,  0.03304987,\n",
       "        0.03097049, -0.03861051, -0.01859398, -0.03090485,  0.03476182,\n",
       "       -0.023477  ,  0.04653121,  0.0080294 ,  0.03464015,  0.00345501,\n",
       "       -0.03523299, -0.01728407, -0.03906243,  0.02210837, -0.01833776,\n",
       "        0.02012639,  0.04922325,  0.00470011, -0.00943834,  0.02619921,\n",
       "        0.03384412, -0.01582938,  0.04630512,  0.04545315, -0.01327803,\n",
       "       -0.0179483 ,  0.02458743,  0.04769922,  0.0107653 , -0.00759454,\n",
       "       -0.02281033,  0.02062598, -0.04458525, -0.02687705,  0.04705691,\n",
       "       -0.03411043, -0.04950541,  0.04093121,  0.02482081,  0.03016852,\n",
       "        0.00169392,  0.04450989, -0.00727047,  0.02242009,  0.00904908,\n",
       "        0.04635107, -0.02762809,  0.042987  , -0.02339032, -0.02509995,\n",
       "       -0.02935593, -0.00908464, -0.0474323 ,  0.03290673, -0.0312223 ,\n",
       "       -0.01526326,  0.04117993,  0.00789633,  0.02756627,  0.0273204 ,\n",
       "       -0.02543853,  0.04193197, -0.00208515, -0.03306155, -0.0178785 ,\n",
       "       -0.04374177,  0.00922784, -0.00426666,  0.00084246, -0.00233007,\n",
       "       -0.02821473, -0.01092132,  0.02471024, -0.01303325,  0.00347391,\n",
       "        0.01872668,  0.04065991,  0.0076809 ,  0.0223825 , -0.00992205,\n",
       "        0.00817276, -0.04605116,  0.04480202, -0.01821453, -0.00224182,\n",
       "       -0.01933362])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F(C,t.size,t,I)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "b5cf0369",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.02421745, -0.02206994,  0.00255382,  0.0461304 , -0.0013434 ,\n",
       "        0.01549033, -0.02938933, -0.02294274, -0.0337128 ,  0.04476461,\n",
       "        0.04121681,  0.0370715 , -0.00550983,  0.0061361 ,  0.03304987,\n",
       "        0.03097049, -0.03861051, -0.01859398, -0.03090485,  0.03476182,\n",
       "       -0.023477  ,  0.04653121,  0.0080294 ,  0.03464015,  0.00345501,\n",
       "       -0.03523299, -0.01728407, -0.03906243,  0.02210837, -0.01833776,\n",
       "        0.02012639,  0.04922325,  0.00470011, -0.00943834,  0.02619921,\n",
       "        0.03384412, -0.01582938,  0.04630512,  0.04545315, -0.01327803,\n",
       "       -0.0179483 ,  0.02458743,  0.04769922,  0.0107653 , -0.00759454,\n",
       "       -0.02281033,  0.02062598, -0.04458525, -0.02687705,  0.04705691,\n",
       "       -0.03411043, -0.04950541,  0.04093121,  0.02482081,  0.03016852,\n",
       "        0.00169392,  0.04450989, -0.00727047,  0.02242009,  0.00904908,\n",
       "        0.04635107, -0.02762809,  0.042987  , -0.02339032, -0.02509995,\n",
       "       -0.02935593, -0.00908464, -0.0474323 ,  0.03290673, -0.0312223 ,\n",
       "       -0.01526326,  0.04117993,  0.00789633,  0.02756627,  0.0273204 ,\n",
       "       -0.02543853,  0.04193197, -0.00208515, -0.03306155, -0.0178785 ,\n",
       "       -0.04374177,  0.00922784, -0.00426666,  0.00084246, -0.00233007,\n",
       "       -0.02821473, -0.01092132,  0.02471024, -0.01303325,  0.00347391,\n",
       "        0.01872668,  0.04065991,  0.0076809 ,  0.0223825 , -0.00992205,\n",
       "        0.00817276, -0.04605116,  0.04480202, -0.01821453, -0.00224182,\n",
       "       -0.01933362])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F2(C,t,I)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "bf3bb91a",
   "metadata": {},
   "outputs": [],
   "source": [
    "def DF(X,t):\n",
    "    result = np.zeros((t.size,X.size))\n",
    "    for i in range(t.size):\n",
    "        result[i,0] = np.exp( - t[i] / X[1])\n",
    "        result[i,1] = X[0] * np.exp(-t[i] / X[1]) * t[i] / (X[1] ** 2)\n",
    "        result[i,2] = np.exp( - t[i] / X[3])\n",
    "        result[i,3] = X[2] * np.exp(-t[i] / X[3]) * t[i] / (X[3] ** 2)\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "e50991f1",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (Temp/ipykernel_14852/3205481453.py, line 7)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"C:\\Users\\dell\\AppData\\Local\\Temp/ipykernel_14852/3205481453.py\"\u001b[1;36m, line \u001b[1;32m7\u001b[0m\n\u001b[1;33m    result[i,1] = (f(t[i],f(X + dx * np.array([0,1,0,0])) - f(t[i],X)) / dx\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "def DF2(X,t):\n",
    "    dx = 0.001\n",
    "    dx = np.array([dx,dx,dx,dx])\n",
    "    result = np.zeros((t.size,X.size))\n",
    "    for i in range(t.size):\n",
    "        result[i,0] = (f(t[i],f(X + dx * np.array([1,0,0,0])) - f(t[i],X)) / dx\n",
    "        result[i,1] = (f(t[i],f(X + dx * np.array([0,1,0,0])) - f(t[i],X)) / dx\n",
    "        result[i,2] = (f(t[i],f(X + dx * np.array([0,0,1,0])) - f(t[i],X)) / dx\n",
    "        result[i,3] = (f(t[i],f(X + dx * np.array([0,0,0,1])) - f(t[i],X)) / dx\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "964c192b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.00000000e+00, 0.00000000e+00, 1.00000000e+00, 0.00000000e+00],\n",
       "       [9.04837418e-01, 1.80967484e-02, 9.80952962e-01, 7.25556925e-04],\n",
       "       [8.18730753e-01, 3.27492301e-02, 9.62268714e-01, 1.42347443e-03],\n",
       "       [7.40818221e-01, 4.44490932e-02, 9.43940346e-01, 2.09454219e-03],\n",
       "       [6.70320046e-01, 5.36256037e-02, 9.25961079e-01, 2.73952982e-03],\n",
       "       [6.06530660e-01, 6.06530660e-02, 9.08324263e-01, 3.35918736e-03],\n",
       "       [5.48811636e-01, 6.58573963e-02, 8.91023377e-01, 3.95424575e-03],\n",
       "       [4.96585304e-01, 6.95219425e-02, 8.74052021e-01, 4.52541727e-03],\n",
       "       [4.49328964e-01, 7.18926343e-02, 8.57403919e-01, 5.07339597e-03],\n",
       "       [4.06569660e-01, 7.31825388e-02, 8.41072914e-01, 5.59885816e-03],\n",
       "       [3.67879441e-01, 7.35758882e-02, 8.25052967e-01, 6.10246277e-03],\n",
       "       [3.32871084e-01, 7.32316384e-02, 8.09338152e-01, 6.58485183e-03],\n",
       "       [3.01194212e-01, 7.22866109e-02, 7.93922658e-01, 7.04665081e-03],\n",
       "       [2.72531793e-01, 7.08582662e-02, 7.78800783e-01, 7.48846907e-03],\n",
       "       [2.46596964e-01, 6.90471499e-02, 7.63966935e-01, 7.91090022e-03],\n",
       "       [2.23130160e-01, 6.69390480e-02, 7.49415628e-01, 8.31452250e-03],\n",
       "       [2.01896518e-01, 6.46068858e-02, 7.35141481e-01, 8.69989918e-03],\n",
       "       [1.82683524e-01, 6.21123982e-02, 7.21139213e-01, 9.06757886e-03],\n",
       "       [1.65298888e-01, 5.95075998e-02, 7.07403647e-01, 9.41809590e-03],\n",
       "       [1.49568619e-01, 5.68360753e-02, 6.93929704e-01, 9.75197069e-03],\n",
       "       [1.35335283e-01, 5.41341133e-02, 6.80712398e-01, 1.00697100e-02],\n",
       "       [1.22456428e-01, 5.14316999e-02, 6.67746844e-01, 1.03718075e-02],\n",
       "       [1.10803158e-01, 4.87533897e-02, 6.55028244e-01, 1.06587436e-02],\n",
       "       [1.00258844e-01, 4.61190681e-02, 6.42551897e-01, 1.09309864e-02],\n",
       "       [9.07179533e-02, 4.35446176e-02, 6.30313187e-01, 1.11889915e-02],\n",
       "       [8.20849986e-02, 4.10424993e-02, 6.18307588e-01, 1.14332024e-02],\n",
       "       [7.42735782e-02, 3.86222607e-02, 6.06530660e-01, 1.16640511e-02],\n",
       "       [6.72055127e-02, 3.62909769e-02, 5.94978047e-01, 1.18819580e-02],\n",
       "       [6.08100626e-02, 3.40536351e-02, 5.83645478e-01, 1.20873324e-02],\n",
       "       [5.50232201e-02, 3.19134676e-02, 5.72528761e-01, 1.22805725e-02],\n",
       "       [4.97870684e-02, 2.98722410e-02, 5.61623784e-01, 1.24620662e-02],\n",
       "       [4.50492024e-02, 2.79305055e-02, 5.50926515e-01, 1.26321908e-02],\n",
       "       [4.07622040e-02, 2.60878105e-02, 5.40432996e-01, 1.27913135e-02],\n",
       "       [3.68831674e-02, 2.43428905e-02, 5.30139349e-01, 1.29397918e-02],\n",
       "       [3.33732700e-02, 2.26938236e-02, 5.20041765e-01, 1.30779734e-02],\n",
       "       [3.01973834e-02, 2.11381684e-02, 5.10136510e-01, 1.32061966e-02],\n",
       "       [2.73237224e-02, 1.96730802e-02, 5.00419920e-01, 1.33247908e-02],\n",
       "       [2.47235265e-02, 1.82954096e-02, 4.90888403e-01, 1.34340761e-02],\n",
       "       [2.23707719e-02, 1.70017866e-02, 4.81538433e-01, 1.35343643e-02],\n",
       "       [2.02419114e-02, 1.57886909e-02, 4.72366553e-01, 1.36259583e-02],\n",
       "       [1.83156389e-02, 1.46525111e-02, 4.63369369e-01, 1.37091529e-02],\n",
       "       [1.65726754e-02, 1.35895938e-02, 4.54543555e-01, 1.37842350e-02],\n",
       "       [1.49955768e-02, 1.25962845e-02, 4.45885847e-01, 1.38514834e-02],\n",
       "       [1.35685590e-02, 1.16689608e-02, 4.37393043e-01, 1.39111693e-02],\n",
       "       [1.22773399e-02, 1.08040591e-02, 4.29062001e-01, 1.39635562e-02],\n",
       "       [1.11089965e-02, 9.99809688e-03, 4.20889641e-01, 1.40089008e-02],\n",
       "       [1.00518357e-02, 9.24768889e-03, 4.12872940e-01, 1.40474521e-02],\n",
       "       [9.09527710e-03, 8.54956048e-03, 4.05008934e-01, 1.40794526e-02],\n",
       "       [8.22974705e-03, 7.90055717e-03, 3.97294713e-01, 1.41051377e-02],\n",
       "       [7.44658307e-03, 7.29765141e-03, 3.89727426e-01, 1.41247366e-02],\n",
       "       [6.73794700e-03, 6.73794700e-03, 3.82304273e-01, 1.41384716e-02],\n",
       "       [6.09674657e-03, 6.21868150e-03, 3.75022509e-01, 1.41465591e-02],\n",
       "       [5.51656442e-03, 5.73722700e-03, 3.67879441e-01, 1.41492093e-02],\n",
       "       [4.99159391e-03, 5.29108954e-03, 3.60872428e-01, 1.41466262e-02],\n",
       "       [4.51658094e-03, 4.87790742e-03, 3.53998877e-01, 1.41390084e-02],\n",
       "       [4.08677144e-03, 4.49544858e-03, 3.47256247e-01, 1.41265485e-02],\n",
       "       [3.69786372e-03, 4.14160736e-03, 3.40642044e-01, 1.41094338e-02],\n",
       "       [3.34596546e-03, 3.81440062e-03, 3.34153822e-01, 1.40878461e-02],\n",
       "       [3.02755475e-03, 3.51196350e-03, 3.27789182e-01, 1.40619619e-02],\n",
       "       [2.73944482e-03, 3.23254489e-03, 3.21545769e-01, 1.40319529e-02],\n",
       "       [2.47875218e-03, 2.97450261e-03, 3.15421275e-01, 1.39979856e-02],\n",
       "       [2.24286772e-03, 2.73629862e-03, 3.09413434e-01, 1.39602215e-02],\n",
       "       [2.02943064e-03, 2.51649399e-03, 3.03520024e-01, 1.39188177e-02],\n",
       "       [1.83630478e-03, 2.31374402e-03, 2.97738867e-01, 1.38739265e-02],\n",
       "       [1.66155727e-03, 2.12679331e-03, 2.92067824e-01, 1.38256958e-02],\n",
       "       [1.50343919e-03, 1.95447095e-03, 2.86504797e-01, 1.37742691e-02],\n",
       "       [1.36036804e-03, 1.79568581e-03, 2.81047729e-01, 1.37197856e-02],\n",
       "       [1.23091190e-03, 1.64942195e-03, 2.75694603e-01, 1.36623805e-02],\n",
       "       [1.11377515e-03, 1.51473420e-03, 2.70443437e-01, 1.36021847e-02],\n",
       "       [1.00778543e-03, 1.39074389e-03, 2.65292291e-01, 1.35393255e-02],\n",
       "       [9.11881966e-04, 1.27663475e-03, 2.60239258e-01, 1.34739261e-02],\n",
       "       [8.25104923e-04, 1.17164899e-03, 2.55282472e-01, 1.34061061e-02],\n",
       "       [7.46585808e-04, 1.07508356e-03, 2.50420097e-01, 1.33359815e-02],\n",
       "       [6.75538775e-04, 9.86286612e-04, 2.45650336e-01, 1.32636646e-02],\n",
       "       [6.11252761e-04, 9.04654086e-04, 2.40971424e-01, 1.31892644e-02],\n",
       "       [5.53084370e-04, 8.29626555e-04, 2.36381633e-01, 1.31128864e-02],\n",
       "       [5.00451433e-04, 7.60686179e-04, 2.31879263e-01, 1.30346331e-02],\n",
       "       [4.52827183e-04, 6.97353862e-04, 2.27462650e-01, 1.29546036e-02],\n",
       "       [4.09734979e-04, 6.39186567e-04, 2.23130160e-01, 1.28728939e-02],\n",
       "       [3.70743540e-04, 5.85774794e-04, 2.18880192e-01, 1.27895970e-02],\n",
       "       [3.35462628e-04, 5.36740205e-04, 2.14711172e-01, 1.27048031e-02],\n",
       "       [3.03539138e-04, 4.91733404e-04, 2.10621561e-01, 1.26185994e-02],\n",
       "       [2.74653570e-04, 4.50431855e-04, 2.06609844e-01, 1.25310704e-02],\n",
       "       [2.48516827e-04, 4.12537933e-04, 2.02674538e-01, 1.24422978e-02],\n",
       "       [2.24867324e-04, 3.77777105e-04, 1.98814189e-01, 1.23523608e-02],\n",
       "       [2.03468369e-04, 3.45896227e-04, 1.95027367e-01, 1.22613360e-02],\n",
       "       [1.84105794e-04, 3.16661965e-04, 1.91312674e-01, 1.21692973e-02],\n",
       "       [1.66585811e-04, 2.89859311e-04, 1.87668734e-01, 1.20763165e-02],\n",
       "       [1.50733075e-04, 2.65290212e-04, 1.84094201e-01, 1.19824628e-02],\n",
       "       [1.36388926e-04, 2.42772289e-04, 1.80587751e-01, 1.18878032e-02],\n",
       "       [1.23409804e-04, 2.22137647e-04, 1.77148090e-01, 1.17924024e-02],\n",
       "       [1.11665808e-04, 2.03231771e-04, 1.73773943e-01, 1.16963231e-02],\n",
       "       [1.01039402e-04, 1.85912499e-04, 1.70464065e-01, 1.15996257e-02],\n",
       "       [9.14242315e-05, 1.70049071e-04, 1.67217229e-01, 1.15023686e-02],\n",
       "       [8.27240656e-05, 1.55521243e-04, 1.64032236e-01, 1.14046081e-02],\n",
       "       [7.48518299e-05, 1.42218477e-04, 1.60907908e-01, 1.13063989e-02],\n",
       "       [6.77287365e-05, 1.30039174e-04, 1.57843089e-01, 1.12077933e-02],\n",
       "       [6.12834951e-05, 1.18889980e-04, 1.54836646e-01, 1.11088422e-02],\n",
       "       [5.54515994e-05, 1.08685135e-04, 1.51887466e-01, 1.10095945e-02],\n",
       "       [5.01746821e-05, 9.93458705e-05, 1.48994460e-01, 1.09100973e-02],\n",
       "       [4.53999298e-05, 9.07998595e-05, 1.46156557e-01, 1.08103962e-02]])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF(C,t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "0f67bbe7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-15353.78670047   2099.51250527  15358.5098083    1780.04304336]\n",
      "[ 237622.21329953    3103.63750527 -237617.4901917     5269.29304336]\n",
      "[-1.50727379e+06 -1.13036249e+03  1.50676651e+06 -5.85070696e+03]\n",
      "[ 321686.21329953   -1035.41718223 -321649.4901917    -3176.70695664]\n",
      "[ 420854.21329953   -1481.81561973 -420849.4901917    -7574.58195664]\n",
      "[ 727286.21329953   -2492.62811973 -727281.4901917   -35003.58195664]\n",
      "[ 2203126.21329953    -5953.62811973 -2203121.4901917   -735675.58195664]\n",
      "[-1.11662178e+07  9.02237188e+03  1.11989905e+07  2.27329604e+08]\n",
      "[-1.82441058e+07  1.65743719e+04  1.85390225e+07  4.74187122e+12]\n",
      "[-1.85062498e+07  2.50863719e+04  1.85390225e+07  6.73306163e+20]\n"
     ]
    }
   ],
   "source": [
    "C_fitting = [[4,8,3,7]]\n",
    "for i in range(10):\n",
    "    Ci = np.array(C_fitting[i])\n",
    "    DFi = DF(Ci,t)\n",
    "    Fi = F2(Ci,t,I)\n",
    "    result = Ci - np.linalg.inv(DFi.T @ DFi) @ (DFi.T @ Fi)\n",
    "    C_fitting.append(list(result))\n",
    "    print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "0eb925d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 2. , 10. ,  3.3, 52. ])"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "8f4f5204",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "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IekNSU13/ysFfM0xWdc40EyrcrhbymtB9nWa2XdL+mNJJ9z9f8pezzCZ2S9LetPdr5S9lhHaK+nHJf2+u39Y0ndU/XJErnad+VFJD0j6AUn3mNmxcldVuoFmWpXD/bqk+2Mf36fWj3VBMbN9agX7mrtfaL/8X2b2gfbnPyDpzbLWNwQ/I+njZnZNrVLbL5jZswr7mq9Luu7uX2l//IJaYR/yNf+ipG+5+1vuflvSBUk/rbCvOZJ1jQPNtCqH+1clPWhmD5jZe9TaiHix5DUNlJmZWnXYl939d2KfelHS8favj0v6s1GvbVjc/TPufp+7z6v1d/o37n5MYV/zf0p63cw+2H7psKR/VcDXrFY55qNmNtX+7/ywWntKIV9zJOsaX5T0mJm918wekPSgpH/o+au4e2X/kfQxSf8m6d8lLZe9niFc38+q9WPZv0j6Wvufj0maVmuX/dX2v/eXvdYhXf/PS/pi+9dBX7OkH5N0uf13/aeS3leDaz4l6RuSXpJ0XtJ7Q7tmSc+ptadwW60780/mXaOk5XaevSLpSD9fm/EDABCgKpdlAAAZCHcACBDhDgABItwBIECEOwAEiHAHgAAR7gAQoP8H554E+xpOe+EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(t,I,c = 'g')\n",
    "for i in range(len(C_fitting)):\n",
    "    I_fitting = f(t,C_fitting[i])\n",
    "    \n",
    "plt.yscale('log')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f8660ecf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
